<div ng-class="todoList">
  <input [(ngModel)]="edit" placeholder="please do something" />
  <input type="button" value="add a new todo" (click)="add()" />
  <div *ngIf="!hasTodo">
    没有todo
    <ul *ngFor="let item of items | async">
      <li>{{item}}</li>
    </ul>
  </div>
  <div *ngIf="hasTodo">
      完成数: {{finished}}
    <ul *ngFor="let todo of data; let i = index">
      <li>
        <i (click)="toggle(i)">{{todo.isComplete ? '√' : '×'}} </i>
        {{todo.name}}
        <span (click)="remove(i)">del</span>
      </li>
    </ul>
  </div>
</div>
